package service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import bean.Test;
import dao.TestDAO;
import service.TestService;

@Service("service")
public class TestServiceImpl implements TestService {
    private final TestDAO dao;

    @Autowired
    public TestServiceImpl(TestDAO dao) {
        this.dao = dao;
    }

    @Override
    public int add(String field2) {
        return dao.add(field2);
    }

    @Override
    public int modify(Test test) {
        return dao.mod(test);
    }

    @Override
    public int remove(int field1) {
        return dao.rem(field1);
    }

    @Override
    public Test query(int field1) {
        return dao.que(field1);
    }

    @Override
    public List<Test> query(String keywords) {
        return dao.que(keywords);
    }
}
